package com.zbl.springdemo.bean.lifecycle;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Component;

/**
 * @author zbl666
 * @desc ware测试
 * @date 2023/1/8 11:33
 */
@Component
public class ApplicationContextAwareDemo implements ApplicationContextAware {

    @Override
    public void setApplicationContext(@NonNull ApplicationContext applicationContext) throws BeansException {
        Object factoryBeanDemo = applicationContext.getBean("factoryBeanDemo");
        System.out.println(factoryBeanDemo);
    }
}
